pp108 : Anchoring Controls

Anchoring Controls

This topic describes the procedure to anchor controls.

Using the anchoring feature, you can specify absolute positions for freely-positioned controls in an XForm.

  1. Open the XForm in the XForms Designer.
  2. Click (Show Anchor Bars) on the XForms Designer toolbar. Alternatively, right-click a control and select Anchors.

    Note:
    The Show Anchor Bars icon ()is available only in the advanced toolbar of the XForms Designer. Check Advanced in the toolbar, to view it. This enables the anchor display mode.

    Note: The anchor display mode is disabled when you first open an XForm in the XForms Designer. Subsequently, Process Platform XForms saves your preferences, and the anchor display mode is enabled or disabled accordingly when you access the XForms Designer the next time.

  3. Click a control. The anchor bars of the control appear. The anchor bars are used to specify the position of the control with respect to the edges of the Designer area.
  4. Place the cursor on the anchor bars of the control to display an editable field (containing a default value), and make appropriate modifications:
    • To anchor a control at an equal distance from all sides of the parent control, place the cursor on the anchor bar at the center of the control, and type the value and the unit of measurement in the editable field that appears.
    • To anchor a control to any side of the parent control, place the cursor on the corresponding anchor bar, and type the appropriate value in the editable field that appears.
    • To anchor a control such that it expands to fill the parent control, click the anchor bar at the center of the control.
    • To remove an anchor from a control, click the anchor bar to deselect it.The control is repositioned according to the options you specify.
  5. Click . The anchor settings for the XForm are saved.

    Important:

    • It is recommended that you use % as the anchor-size unit for controls that are anchored on all sides and are expected to resize with reference to the parent.
    • If you use units other than % to specify the fixed anchor size for controls, then on reducing the XForm's size, the controls that are anchored on all sides may become too small to be viewed properly.
    • It is recommended that you use em as the unit to specify the anchor size in terms of the text size used in the browser. This is suitable for scenarios where XForms are viewed in various resolutions.